home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / clipper / nannws22.zip / DIM.PRG < prev    next >
Text File  |  1987-12-08  |  378b  |  20 lines

  1. * CREATING TWO-DIMENSIONAL ARRAYS
  2. * F. Ho
  3. *
  4. * The example below declares a two-dimensional array:
  5.  
  6. clear
  7. ITEMS = 2                  && or you may define ITEMS
  8. ELEMENTS = 7               && and ELEMENTS at run-time
  9. declare WEEK[ITEMS * ELEMENTS]
  10.  
  11. WEEK[DIM2(1,2)] = "Sun"
  12.  
  13. ? WEEK[DIM2(1,2)]
  14. quit
  15.  
  16.  
  17. function DIM2
  18. parameters X,Y
  19. return(((X - 1) * ELEMENTS) + Y)
  20.